Hello and welcome.
In this video we are going to create a function that will draw the clock numbers.
So this is what our code looks like at the moment.
And this is what we've been able to achieve so far.
So by the end of this Late Show we should have Plock numbers on the clock.
So what I'm going to do I've already pre staged the code I'm going to add the block of code and do my
best to explain what the code does.
So just underneath it you can call a function.
Anyway if he notices draw a clock function here is inside that function we are also calling this trophy's
function.
We're going to create a form of cord draw numbers.
And again we are going to add that here.
In fact let me do that now.
I'm just going to call this draw
numbers inside the pen this is I'm going to also reference the CIT context and the radius.
So this is going to be a function that I am going to create in a minute.
I'm referencing it inside those clocks and when this clock functioned clock runs it who caught this
and then call this function.
So I'm just going to tab down to the bottom.
This class function here and just add the block of code for our drawn numbers function.
So I've added a block of code that would draw the numbers on the clock so this is the code here.
This is the block of call.
So I'll do my best to run through it with you.
So got a couple of variables here.
Variable call and variable Quad nump we've online 36.
Basically we are set in the font size of the drive object to be half 10 percent of the radius.
That's what this line to six dots line thirty seven and thirty eight is used to set the text.
I meant to the middle and the centre of the print position.
And for the rest of the record from line third in line to 47.
We are calculating the print position for 12 numbers to 85 percent of the radius.
We are going to have that rotated.
I will quote the p y divided by 6.
So we hear what the mass of p y property are divided by 6 for each of the numbers of the clock.
So these are various methods here.
So we using the retard metter.
And we pass in in this variable and here which responder will for the angle and we use in the Translate
method here as also.
As I explained in previous video the translation basically is used to remap a position on the X and
Y axis of the compass.
Here we are looking for the three we rotating using the routed met.
Again this time we are using in negative value here.
Notice on 4 to 1 is a positive.
Fourth that rule is using negative value and only 44 is in the field text.
This is what will actually put the text on the clock and we're referencing the number variable and we're
converting it to string.
Okay and these are the values again here fortify were referencing the routed method used in the variable
we defined on line 34.
We use in the.
Again here we have this values here.
And again we use the return method with negative for this variable so that basically should create the
numbers for the clock.
So I'm just going to save this akhlaghi saved.
Or we can go back to our hysteria and see what it looks like.
Okay the numbers have not showed up so there must be a slight error in the could.
It's going to go back into the court and have a look.
What I may have done wrong.
So let me take a look.
The function is called drop numbers let me see.
Ah okay.
This is where my error is the functions Quadron numbers and I'm just called did draw a number so obviously
it will not run sign it or add it s I save that and try and run refresh the clock again and see.
So now we have the numbers showing up on the face of the clock.
Oh that's excellent So if you are on the same page and you got yours working also many congratulations
in the next lecture.
Are we going to quit this function that will be used to draw the hand for the clock.
So thank you for watching and see you in the next lecture.
Bye for now.